home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / MapMaker / Source / pointdata.h < prev    next >
Text File  |  1990-12-04  |  1KB  |  47 lines

  1. /* This is pointdata.h, header for pointdata.c. */
  2. /* This module is a standard ANSI C point-data */
  3. /* List implementation.  Format of a point is : */
  4.  
  5. #define BLOCKSIZE 100
  6. #define UP 1
  7. #define DOWN 0
  8. #define SKIP -1
  9.  
  10. typedef struct  {
  11.     float x;
  12.     float y;
  13.     int pen;
  14.     float pencolour;
  15. } Point;
  16.  
  17. typedef Point pointBlock[BLOCKSIZE];
  18.  
  19. typedef struct pnode {
  20.     pointBlock block;
  21.     int contains;
  22.     struct pnode *next;
  23. } pointNode;
  24.  
  25. typedef struct pointlist {
  26.     pointNode *head;
  27.     pointNode *tail;
  28.     pointNode *curr;
  29.     int currpos;
  30.     int currtot;
  31.     int quantity;
  32. } PointList;
  33.  
  34. void newPointList(PointList *p);
  35. void freePointList(PointList *p);
  36. int addToPointList(PointList *p, Point *pt);
  37. int removeFromPointList(PointList *p,int index);
  38. int insertInPointListAt(PointList *p,Point *pt, int index);
  39. int gotoPointInList(PointList *p,int index,Point **pt);
  40. int gotoNextPointInList(PointList *p, Point **pt);
  41. int lastPointInList(PointList *p, Point **pt);
  42. void doTestShape(PointList *p);
  43. int savePointList(PointList *p,char *fn);
  44. int loadPointList(PointList *p,char *fn);
  45. int nearestPointInList(PointList *p,Point **pt,float x,float y,int *index);
  46.  
  47.